/**
 * Created by Administrator on 2018/10/29 0029.
 */
var loginapp = angular.module('loginapp', ["ngTable"]);                     //根app加载


//***********************************************************************************************公共工具代码
//自动消失的提示对话框插件
function showPopover(target, msg) {
    target.attr("data-original-title", msg);
    $('[data-toggle="tooltip"]').tooltip();
    target.tooltip('show');
    target.focus();
    //2秒后消失提示框
    var id = setTimeout(
        function () {
            target.attr("data-original-title", "");
            target.tooltip('hide');
        }, 2000
    );
}

//返回已经选择好的selectlist对象
function returnSelectList(selectlist) {
    returnlist = []
    for (i in selectlist) {
        if (selectlist[i] == true) {
            returnlist.push(i);
        }
    }
    return returnlist;
}


//返回所有符合条件的simplelist对象
function returnsimpleList(selectlist,objlist) {
    returnList = []
    for (i in selectlist) {             //遍历所有选中
        for (j in objlist) {                    //遍历service list进行查找
            if (objlist[j].id == selectlist[i]) {   //如果当前id是遍历的id
                returnList.push(j)
            }
        }
    }
    return returnList
}
